package com.team10.hotel.service.impl;

import com.team10.hotel.domain.Province;
import com.team10.hotel.mapper.ProvinceMapper;
import com.team10.hotel.service.ProvinceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProvinceServiceImpl implements ProvinceService {

    @Autowired
    private ProvinceMapper provinceMapper;

    @Override
    public List<Province> findAllByCountryId(Integer countryId) {
        return provinceMapper.selectByCountryId(countryId);
    }

    @Override
    public List<Province> findAll() {
        return provinceMapper.selectAll();
    }

    @Override
    public int findCountryId(Integer provinceId) {
        return provinceMapper.selectCountryId(provinceId);
    }

    @Override
    public Province findByPrimaryKey(Integer provinceId) {
        return provinceMapper.selectByPrimaryKey(provinceId);
    }


}
